package com.Lixiaoqian.Gulangyu.utils;

import android.content.Context;
import android.widget.Toast;

/**
 * Created by HuangZhiBo on 2017/2/20/020.
 * email:1043202454@qq.com
 */

public class ToastUtils {

    public static boolean isShow = true;
	private static Context mContext;
	  /**
     * 设置上下文
     * @param context
     */
	public static void setContext(Context context){
		mContext=context;
	}
    /**
     * 短时间显示Toast
     * @param message
     */
    public static void showShort(CharSequence message)
    {
        if (isShow)
            Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
    }

    /**
     * 短时间显示Toast
     *
     * @param message
     */
    public static void showShort(int message)
    {
        if (isShow)
            Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show();
    }

    /**
     * 长时间显示Toast
     *
     * @param message
     */
    public static void showLong(CharSequence message)
    {
        if (isShow)
            Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();
    }

    /**
     * 长时间显示Toast
     *
     * @param message
     */
    public static void showLong(int message)
    {
        if (isShow)
            Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();
    }

}
